
import request from '@/plugin/axios'

// 获取分页列表
export function getrolepage (params) {
    return request({
      url: '/upms/role/page',
      method: 'get',
      params: request.adornParams(params)
    })
  }
// 获取列表
export function getrolelist (params) {
  return request({
    url: '/upms/role/list',
    method: 'get',
    params: request.adornParams(params)
  })
}

// export function getrolesyslist (params) {
//     return request({
//       url: '/upms/role/syslist',
//       method: 'get',
//       params: request.adornParams(params)
//     })
//   }

//   export function getrolebuslist (params) {
//     return request({
//       url: '/upms/role/buslist',
//       method: 'get',
//       params: request.adornParams(params)
//     })
//   }

  // 获取用户角色信息
export function getuserroleinfo (id) {
    return request({
      url: '/upms/role/user/' + id,
      method: 'get',
      params: request.adornParams({})
    })
  }

// 获取信息
export function getroleinfo (id) {
  return request({
    url: '/upms/role/info/' + id,
    method: 'get',
    params: request.adornParams({})
  })
}

// 添加
export function addbusrole (data) {
  return request({
    url: '/upms/role/bussave',
    method: 'post',
    data
  })
}

export function addsysrole (data) {
    return request({
      url: '/upms/role/syssave',
      method: 'post',
      data
    })
  }

// 修改
export function updaterole (data) {
  return request({
    url: '/upms/role/update',
    method: 'put',
    data
  })
}

// 批量删除
export function delBatchrole (params) {
  return request({
    url: '/upms/role/delete',
    method: 'delete',
    data: request.adornData(params, false)
  })
}

// 删除
export function delrole(id) {
  return request({
    url: '/upms/role/delete/' + id,
    method: 'delete',
  })
}